﻿<%@ Page Title="" Language="C#" MasterPageFile="~/TimKenSite.Master" AutoEventWireup="true"
    CodeBehind="Inbox.aspx.cs" Inherits="TimKen.Web.User.Inbox" %>

<%@ Register Src="../UserControls/UserCenter.ascx" TagName="UserCenter" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <link href="../Common/Style/PagerStyle.css" rel="stylesheet" type="text/css" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Title" runat="server">
    <uc1:UserCenter ID="ucUserCenter" runat="server" />
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="body" runat="server">
    <style type="text/css">
        .inboxtable th
        {
            border-bottom: 1px solid #CCC;
            line-height: 24px;
        }
        
        .inboxtable td
        {
            border-bottom: 1px dashed #CCC;
            line-height: 22px;
        }
    </style>
    <form runat="server">
    <asp:ScriptManager runat="server">
    </asp:ScriptManager><asp:UpdatePanel runat="server">
       <ContentTemplate>
    <!--未按html制作--->
    <div class="rtitle">
        
        <%=GetLangString("MenuInbox")%>
    </div> 

           <div class="rightbt">
                <asp:CheckBox ID="chkIsRead"  runat="server" AutoPostBack="true" OnCheckedChanged="chkIsRead_CheckedChanged" />
                <%=GetLangString("MessageUnRead") %>
            </div>

    <asp:GridView ID="grdInbox" runat="server" AutoGenerateColumns="False" 
        OnRowCommand="grdInbox_RowCommand" DataKeyNames="MsgID" Width="740" 
        CssClass="inboxtable" BorderStyle="None" GridLines="None">
        <Columns>
            <asp:TemplateField>
                <HeaderTemplate>
                    <%=GetLangString("MessageTitle")%>
                </HeaderTemplate>
                <ItemTemplate>
                    <%#GetMessageStatusPic(Eval("IsRead"))%>
                    <a href='MessageView.aspx?MsgID=<%#Eval("MsgID")%>'>
                        <%#Eval("Title")%></a>
                </ItemTemplate>
                <HeaderStyle HorizontalAlign="Left" />
                <ItemStyle HorizontalAlign="Left" />
            </asp:TemplateField>
            <asp:TemplateField>
                <HeaderTemplate>
                    <%=GetLangString("MessageFrom")%>
                </HeaderTemplate>
                <ItemTemplate>
                    <%#Eval("FromID")%>
                </ItemTemplate>
                <HeaderStyle Width="80px" />
                <ItemStyle HorizontalAlign="Center" />
            </asp:TemplateField>
            <asp:TemplateField>
                <HeaderTemplate>
                    <%=GetLangString("MessageCreateDate")%>
                </HeaderTemplate>
                <ItemTemplate>
                    <%#DataBinder.Eval(Container.DataItem, "CreateDate", "{0:yyyy-MM-dd}")%>
                </ItemTemplate>
                <HeaderStyle Width="80px" />
                <ItemStyle HorizontalAlign="Center" />
            </asp:TemplateField>
            <asp:TemplateField>
                <HeaderTemplate>
                    <%=GetLangString("Operation") %>
                </HeaderTemplate>
                <ItemTemplate>
                    <asp:ImageButton ID="btnDelete" runat="server" ImageUrl="~/images/deleteCard.gif"
                        ToolTip='<%=GetLangString("Delete") %>' CommandArgument='<%=Eval("MsgID") %>'
                        CommandName="DeleteMessage" />
                </ItemTemplate>
                <HeaderStyle Width="60px" />
                <ItemStyle HorizontalAlign="Center" />
            </asp:TemplateField>
        </Columns>
        <EmptyDataTemplate>
            <span class="errortext">
                <%=GetLangString("InboxEmpty")%></span>
        </EmptyDataTemplate>
    </asp:GridView>
    <ux:aspnetpager ID="AspNetPager1" CssClass="paginator" CurrentPageButtonClass="cpb"
                            runat="server" FirstPageText="首页" LastPageText="尾页" NextPageText="下一页"
                             Width="95%" ShowPageIndexBox="Always"  PageSize="8"
            HorizontalAlign="right" EnableTheming="true" AlwaysShow="true" PageIndexBoxType="DropDownList"
            OnPageChanged="AspNetPager1_PageChanged"  
            ButtonImageNameExtension="n" CpiButtonImageNameExtension="r"  
            ShowCustomInfoSection="Left"
                            ShowNavigationToolTip="true" CustomInfoTextAlign="Left" 
            LayoutType="Table" CustomInfoHTML="">
    </ux:aspnetpager> 
    <div class="msglist">
        <%=GetLangString("MenuInboxSend")%>
    </div>
    <asp:GridView ID="grdInbox2" runat="server" AutoGenerateColumns="False" OnRowCommand="grdInbox2_RowCommand"
        DataKeyNames="MsgID" Width="740" CssClass="inboxtable" BorderStyle="None" 
        GridLines="None">
        <Columns>
            <asp:TemplateField>
                <HeaderTemplate>
                    <%=GetLangString("MessageTitle")%>
                </HeaderTemplate>
                <ItemTemplate>
                    <a href='MessageSendView.aspx?MsgID=<%=Eval("MsgID")%>'>
                        <%#Eval("Title")%></a>
                </ItemTemplate>
                <HeaderStyle HorizontalAlign="Left" />
                <ItemStyle HorizontalAlign="Left" />
            </asp:TemplateField>
            <asp:TemplateField>
                <HeaderTemplate>
                    <%=GetLangString("MessageTo")%>
                </HeaderTemplate>
                <ItemTemplate>
                    <%#Eval("ToID")%>
                </ItemTemplate>
                <HeaderStyle Width="80px" />
                <ItemStyle HorizontalAlign="Center" />
            </asp:TemplateField>
            <asp:TemplateField>
                <HeaderTemplate>
                    <%=GetLangString("MessageCreateDate")%>
                </HeaderTemplate>
                <ItemTemplate>
                    <%#DataBinder.Eval(Container.DataItem, "CreateDate", "{0:yyyy-MM-dd}")%>
                </ItemTemplate>
                <HeaderStyle Width="80px" />
                <ItemStyle HorizontalAlign="Center" />
            </asp:TemplateField>
            <asp:TemplateField>
                <HeaderTemplate>
                    <%=GetLangString("Operation") %>
                </HeaderTemplate>
                <ItemTemplate>
                    <asp:ImageButton ID="btnDelete" runat="server" ImageUrl="../Common/Image/deleteCard.gif"
                        ToolTip='<%=GetLangString("Delete") %>' CommandArgument='<%=Eval("MsgID") %>'
                        CommandName="DeleteMessage" />
                </ItemTemplate>
                <HeaderStyle Width="60px" />
                <ItemStyle HorizontalAlign="Center" />
            </asp:TemplateField>
        </Columns>
        <EmptyDataTemplate>
            <span class="errortext">
                <%=GetLangString("InboxEmpty")%></span>
        </EmptyDataTemplate>
    </asp:GridView>
    <ux:aspnetpager ID="AspNetPager2" CssClass="paginator" CurrentPageButtonClass="cpb"
                            runat="server" FirstPageText="首页" LastPageText="尾页" NextPageText="下一页"
                             Width="95%" ShowPageIndexBox="Always"  PageSize="8"
            HorizontalAlign="right" EnableTheming="true" AlwaysShow="true" PageIndexBoxType="DropDownList"
            OnPageChanged="AspNetPager2_PageChanged"  
            ButtonImageNameExtension="n" CpiButtonImageNameExtension="r"  
            ShowCustomInfoSection="Left"
                            ShowNavigationToolTip="true" CustomInfoTextAlign="Left" 
            LayoutType="Table" CustomInfoHTML="">
    </ux:aspnetpager> 
    </ContentTemplate>
    </asp:UpdatePanel>
    </form>
</asp:Content>
